package com.longjianghuasheng.logistics.business.wallet.adapter

import com.blankj.utilcode.util.ColorUtils
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseDataBindingHolder
import com.longjianghuasheng.logistics.R
import com.longjianghuasheng.logistics.databinding.ItemWalletBinding
import com.longjianghuasheng.logistics.entity.WalletLists
import com.xuexiang.xui.utils.WidgetUtils

class WalletAdapter :
    BaseQuickAdapter<WalletLists, BaseDataBindingHolder<ItemWalletBinding>>(R.layout.item_wallet) {

    override fun convert(holder: BaseDataBindingHolder<ItemWalletBinding>, item: WalletLists) {
        holder.dataBinding?.run {

            tvMonth.text = item.date

            val walletMonthAdapter = WalletMonthAdapter()

            rvWalletMonth.run {
                setHasFixedSize(true)
                isNestedScrollingEnabled = false
                WidgetUtils.initRecyclerView(this, 1, ColorUtils.getColor(R.color.baseBackground))
                adapter = walletMonthAdapter
            }

            walletMonthAdapter.setNewInstance(item.lists)


        }
    }
}